package com.dsx.haha.filter;

import com.dsx.haha.utils.RedPrint;
import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

/**
 * @author dsx
 * @date 2021/3/16 12:57
 * @since JDK1.8
 */
@Activate
public class DubboProviderFilter implements Filter {
    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        String sessionid = RpcContext.getContext().getAttachment("sessionid");
        RedPrint.print("provider中取到的sessionid===="+sessionid);
        Result result = invoker.invoke(invocation);
        return result;
    }
}
